<template>
	<view class="y-page-common page">
		<view class="card form">
			<view class="card-item">
				<view class="title">
					法定代表人身份证人像面					
				</view>
				<view class="main">
					<view class="image-content" @click="changeImg(1)">
						<image style="width: 100%; height: 100%; background-color: #eeeeee;" mode="scaleToFill"
							:src="src1"></image>
					</view>
					<view class="icons-section">
						<view class="icons-item">
							<uni-icons custom-prefix="custom-icon" type="image" size="30"></uni-icons>
							<view class="icon-text">
								重拍
							</view>
						</view>
						<view class="icons-item">
							<uni-icons custom-prefix="custom-icon" type="trash" size="30"></uni-icons>
							<view class="icon-text">
								删除
							</view>
						</view>
					</view>
				</view>
				<view class="tips"><span style="color:red;">*</span>务必拍摄身份证原件,以免影响您的申请</view>
			</view>
			<view class="card-item">
				<view class="title">
					法定代表人身份证国徽面					
				</view>
				<view class="main">
					<view class="image-content" @click="changeImg(2)">
						<image style="width: 100%; height: 100%; background-color: #eeeeee;" mode="scaleToFill"
							:src="src2"></image>
					</view>
					<view class="icons-section">
						<view class="icons-item">
							<uni-icons custom-prefix="custom-icon" type="image" size="30"></uni-icons>
							<view class="icon-text">
								重拍
							</view>
						</view>
						<view class="icons-item">
							<uni-icons custom-prefix="custom-icon" type="trash" size="30"></uni-icons>
							<view class="icon-text">
								删除
							</view>
						</view>
					</view>
				</view>
				<view class="tips"><span style="color:red;">*</span>务必拍摄身份证原件,以免影响您的申请</view>
			</view>
		</view>
		
		<ReadmeBtn fixed="true" :readme="[]" text="提交" @submit="submit"></ReadmeBtn>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				src1: '../../static/imgs_personal/img_collect1.jpg',
				src2: '../../static/imgs_personal/img_collect2.jpg'
			}
		},
		onLoad() {
		},
		methods: {
			changeImg(type) {
				type === 1 ? this.src1 = '../../static/imgs_personal/card1.webp' : this.src2 =
					'../../static/imgs_personal/card2.webp'
			},
			async submit() {
				// 返回额度申请页面
				await this.$myloading() // async
				uni.setStorageSync('zlcjInfo', true);
				uni.redirectTo({
					url: '/pages/index/success?go=1&title=税务授权结果&text=税务认证已通过，请返回进行后续操作&go=2&btn=返回'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		width: 100%;
		height: 100%;
		.title {
			font-size: 30rpx;
			margin: 30rpx 0;
		}
		.main {
			border: 1rpx solid gray;
			padding: 30rpx;
			.image-content {
				height: 40vw;
				margin: 0 auto 40rpx;
				overflow: hidden;

			}
			.icons-section {
				
				width: 100%;
				display: flex;
				justify-content: space-around;
				.icons-item {
					display: flex;
					flex-direction: column;
				}
			}
		}
		.tips {
			margin: 20rpx 0;
		}
	}
</style>